package com.zonski.jbots.desktop.game;

import java.awt.Panel;
import java.awt.Image;
import java.awt.Graphics;
import java.awt.Component;
import java.awt.GridBagLayout;
import java.awt.GridBagConstraints;

/**
 * Created by IntelliJ IDEA.
 * User: Chris Glover
 * Date: Oct 9, 2003
 * Time: 12:47:24 AM
 * To change this template use Options | File Templates.
 */
public class JBotsPanel extends Panel
{
    private Image backgroundImage;

    public JBotsPanel()
    {
        initLayout();
    }

    private final void initLayout()
    {
        //this.backgroundImage = this.getToolkit().createImage(this.getClass().getClassLoader().getResource("images/console/console.gif"));
        //this.setSize(backgroundImage.getWidth(this), backgroundImage.getHeight(this));
        this.setSize(480, 320);
        this.setLayout(new GridBagLayout());
    }

    public void addCentrePanel(Component component)
    {
        GridBagConstraints c = new GridBagConstraints();
        c.fill = GridBagConstraints.NONE;
        c.anchor = GridBagConstraints.CENTER;
        this.add(component, c);
    }

    public void paint(Graphics g)
    {
        g.setColor(this.getBackground());
        g.clearRect(0, 0, this.getWidth(), this.getHeight());
        //g.drawImage(this.backgroundImage, 0, 0, this);
    }
}
